<?php
include "../function.php";
include "../include/admin.class.php";
$pro=new Product();
$admin = new Admin();
$admin->limit(32);


if($_GET['request'] == 1){
	echo json_encode($pro->getTypes());
}

if($_GET['request'] == 2){
	echo json_encode($pro->getTypes($_GET['id']));
}

if($_GET['request'] == 3){
	$data = $pro->getAllByField('p_id',$_GET['good']);
	echo json_encode($pro->getTypeLink($data['type']));
}


?>